import React from 'react';
import {Button} from 'antd'
import {observer,inject} from 'mobx-react'

@inject('test')
@observer
class Test extends React.Component {
  constructor() {
    super();
    this.clickHandle = this.clickHandle.bind(this)
  }
  clickHandle(){
    this.props.test.alertMsg()
  }
  render() {
    let {name} = this.props.test
    return (
      <div>
        <Button onClick={this.clickHandle}>{name}</Button>
      </div>
    );
  }
}

export default Test;
